/*
 * Created on 6 mai 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package fr.jade.util;

import java.util.Set;
import java.util.Vector;

/**
 * @author ssicard
 *
 */
public class CollectionUtil {
	
	public static Vector objectArray2Vector(Object[] array){
		Vector v = new Vector();
		for(int i=0; i<array.length; i++){
			v.add(array[i]);
		}
		return v;
	}
	
	public static Object checkAndGetSingleton(Set<?> set){
	  assert set.size() ==1 : "Set must contain exactly one element";
	  return set.iterator().next();
	}
}
